package com.hwadee.property.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> {
    private int total;   // 总记录数
    private int current; // 当前页码
    private int size;    // 每页大小
    private List<T> records; // 当前页的数据

    public static <T> PageResult<T> of(int total, int current, int size, List<T> records) {
        return new PageResult<>(total, current, size, records);
    }
}
